The present invention relates to a process for scanning bar codes, and more particularly to a process for decoding a "deteriorated" bar code.
As is known, bar codes are widely used in the automatic identification of products.
A bar code is made up by a set of clear and dark zones, referred to in the following as space and/or bar type elements. Such elements have a rectangular shape and each of them may have a different width value.
A set of elements represents a code character univocally and a set of characters represents a symbol of a particular code univocally.
In fact, each code is defined by a set of rules that are the coding and decoding protocol for such particular type of code. Hence, a given set of characters that satisfies such protocol represents the decoded symbol of the code being examined.
Different processes for scanning and decoding bar code symbols are known in the art. A typical process may be summarised as follows: a bar code reading device illuminates the code to be identified along a reading line; the diffused light is picked up by a photosensor which generates, in its turn, an analog signal proportional to the intensity of the diffused light.
Said analog signal is processed by a block called digitaliser, whose task is to extract from the analog signal the numeric characteristics that represent it completely, so as to define a scanning of the code being examined.
Such scanning is then elaborated by a bar code decoding programme, which, based on a protocol for decoding the particular type of code, classifies the individual characters one at a time, starting from a synchronism character of start until a synchronism character of stop is reached, so as to provide as a conclusion the set of characters that define the decoded symbol of the bar code being examined.
One of the basic limits of the decoding process described hereinabove lies in that, if the label carrying the code to be decoded shows some alterations (such as, for instance, spots, abrasions or smears) on some points wherethrough the scanning is performed, the decoding process stops as it cannot decode the altered characters of the code, and gives an error indication. In this case, all the information obtained from the processing of said scanning are rejected and a new scanning process, carried out on a different zone of the label, is tried, until a complete string of decoded characters is obtained.
However, such process cannot ensure the decoding of deteriorated or locally altered labels, due to the impossibility of finding an entirely clean scanning.
Local alterations of labels cause reading errors that may be generally classified into three categories:
split-like error: this happens when an individual element (bar or space) is digitalised as if it were at least three smaller elements (a typical error caused by a small width abrasion or spot on the label); PA1 merge-type error: this happens when at least an individual element is ignored during the digitalisation, with ensuing merging of the same with the two adjoining elements into one only element (a typical error caused by a large width abrasion or spot on the label); PA1 misread-type error: this happens when, along a given scanning line, an individual element is digitalised in a distorted manner, altering the classification to a significant extent (a typical error caused by a print smear). PA1 a) acquisition of a first bar code scanning along a scanning line, PA1 b) identification of the belonging family of the bar code, and, being characterised in that it further comprises the following steps: PA1 c) determination of the width of at least one of the synchronism characters, PA1 d) calculation of an estimated width of each character of the code being examined, based on the width of the synchronism character considered, PA1 e) identification, by way of first approximation, of a character following one of the synchronism characters by counting a number of m elements equal to the number of elements that make up each character in the belonging family identified, PA1 f) determination of the potential width of said following character, PA1 g) checking whether the potential width of such following character differs from the estimated width of a lower quantity with respect to a prefixed tolerance, and: PA1 if said decoding gives a positive result: PA1 storing of the decoded character in a decoding string intended for containing a first set of hypothetical values of the code characters, PA1 updating of the estimated width of the character of the code being examined depending on the decoded character, PA1 if said decoding gives a negative result: PA1 identification of said character as an "undecodable character", and repeating of steps e) through g) for each following character. PA1 m is the module estimate performed throughout the scanning, wherein the module is the width of the smallest element of the scanning, PA1 e.sub.i is the value of the width of the i.sup.th element of the character, PA1 e.sub.i * is the value of the width of the ideal i.sup.th corresponding element in the classified character, PA1 d is the greatest of the distances of each element from its own ideal value. PA1 h) identification, by way of second approximation, of the character following one of the synchronism characters, counting a number of elements equal to m.+-.2, PA1 i) determination of a new potential width of such following character as identified by way of second approximation, PA1 l) checking if said new potential width differs from the estimated width of a lower quantity with respect to the prefixed tolerance, and: PA1 m) counting of a number of m elements equal to twice the number of m elements that make up each character in the belonging family identified, PA1 n) determination of the width of said 2m counted elements, PA1 o) checking whether such width differs from twice the estimated width of a lower quantity with respect to the prefixed tolerance, and: PA1 14a) if, in the considered position, a decoded character and an undecodable character are found, the value of the decoded character is stored in the current string, PA1 14b) if, in the considered position, two equal decoded characters are found having a different coefficient of associate error, the value of the character having the lowest coefficient of associated error is stored in the current string, PA1 14c) if, in the considered position, two different decoded characters are found, the value of the character having the lowest coefficient of associated error is stored in the current string, PA1 14d) if, in the considered position, two undecodable characters are found, an unknown character is stored in the current string. PA1 15a) acquisition of a new bar code scanning, according to a new scanning line, PA1 15b) obtaining a new set of hypothetical values of the code characters according to steps e) through o2), PA1 15c) comparison of such new set of hypothetical values with the previously processed current string, in order to update such string according to steps 14a) through 14d), PA1 15d) reiteration of steps 15a) through 15c) until all the characters of the current string have been decoded, PA1 15e) performation of a validation try of the decoded characters of the current string. PA1 18a) providing of a partly or entirely decoded first string of data, comprising a plurality of decoded characters and an error coefficient associated to each decoded character, PA1 18b) storing of said first string in a buffer A, PA1 18c) updating with said first string of a buffer B, intended for containing consolidated data, PA1 18d) storing of a second string in buffer A, PA1 18e) updating of buffer B with said second string, PA1 18f) if buffer B contains a complete string of entirely decoded characters, performing of a validation try of said complete string, PA1 18g) if the validation try gives a positive result, rendering the decoded string available, PA1 18h) if the validation try gives a negative result, acquisition of a third string and reiteration of steps 18d) through 18f).
The aforementioned errors may be found also at the same time on a same scanning line of the code being examined, stopping or in any case invalidating the decoding process of the code along such particular scanning, so that the analysis of a subsequent code scanning becomes necessary. In order to produce a feasible and/or quicker decoding scanning, several processes have been proposed in the last years, wherein the code decoding is performed by utilising information taken from several scannings.
For instance, the U.S. Pat. No. 5,262,626 discloses a method for decoding a bar code symbol wherein the information obtained from two different scannings are compared to one another in order to process a complete decoding string. More particularly, the elements of the undecoded characters of a first scanning are iteratively replaced by the elements of the decoded characters of a second scanning having the same position within the code being examined, obtaining in this way an increasingly complete decoding string. If two compared scannings should have, in the same position, two different decoded characters, the known art suggests that the scanning containing the highest number of decoded characters be kept. Besides, if both scannings should have the same decoded characters, the known art suggests that the most recent scanning be kept and a new scanning acquired.
Even though it satisfies the need of accelerating the decoding process, the above described process has several drawbacks.
A first drawback is related to the high computation effort associated to the fact of working with the individual elements of the characters.
A second drawback is related to the low reliability of such decoding process. Actually, the decoded characters are submitted neither to controls nor to exactness checks: this may lead to the processing of a complete but not correctly validable decoding string or, still worse, to a string that, while being validable, does not correspond to the original string.
More particularly, if both of the compared scannings have two different decoded characters in the same position, the decision of considering as "good" the character belonging to the scanning containing the highest number of decoded characters does not provide any warranty as concerns the real validity and/or exactness of said character. In this case it may happen that a character be identified that actually does not exist in the label being examined, attributing therefore to said label a wrong code symbol. Such drawback is partly overcome by U.S. Pat. No. 5,438,188, which teaches a decoding process wherein the classification of the individual characters of a scanning is performed by comparing the elements of the code being examined with all the possible characters defined in the protocol of such particular type of code; an error coefficient is calculated for each comparison and the character with the lowest error coefficient is classified. The decoding of the bar code symbol is carried out thereafter by comparing the information iteratively obtained from two different following scannings, and considering as "good" the decoded character that has, in that particular position, the lowest associated error coefficient.
Such decoding technique, while being an improvement as concerns the reliability of the decoded characters, has still the drawback of requiring high calculation resources for the processing of the individual scannings. Such drawback is due to the necessity of carrying out, for each element of the code, a comparison with all the possible characters of the decoding protocol. Therefore, this process requires a particularly exacting computation effort, which often translates into long decoding times.
In fact, it should be kept in mind that the calculation resources necessary for the decoding and the decoding time are parameters of basic importance for the selection of the decoding programme to be utilised and limit often the application field of said programme.
For instance, the calculation resource parameter is particularly important in case of utilisation of code scanning devices of the manual type, which, for reasons of cost, have limited storing availability and calculation power.
Instead, the time factor is particularly important especially in the cases where--as for instance in shop counters or product storehouses--the identification of the code must take place as quickly as possible, not to create a bottleneck to the flow of goods to be identified.
A further drawback of all the aforementioned decoding processes concerns the impossibility, for the decoding programmes, of completing the reading of the scanning each time an undecodable characters is found in the same.
In such situation, the decoding programmes cannot read the code characters following the zone where an error has been found. In fact, as such programmes cannot distinguish the code zone invalidated by an error from the code zone related to the following character, they cannot determine the point where they should start anew the decoding of the code characters. Therefore, the decoding proceeds with the acquisition of a new scanning and the comparison of the two acquired scannings, to process a complete decoding string of the symbol of the code being examined.
It can be easily understood that, in case of very deteriorated labels, the utilisation of the aforementioned processes involves the need of providing to the acquisition of a high number of scannings before being able to process a complete decoding string. This involves a rather long decoding time and a very high use of calculation resources, which factors, as has been said, are both of a basic importance.